<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="application/msword"/>
    <title th:text="${url}"></title>
    <style type="text/css">
        body {
            font-size: 14px;
        }

        tr {
            height: 26px;
            font-size: 14px;
        }

        table {
            border-collapse: collapse;
        }

        table, th, td {
            border: 1px solid black;
        }

        .specialHeight {
            height: 40px;
        }

        .bg {
            font-weight: bold
        }
    </style>
</head>

<body>
<div style="width:800px; margin: 0 auto">
    <div th:each="table:${tables}">
        <!--这个是类的说明
        <h4 th:text="${table.title}"></h4>-->
        <!--这个是每个请求的说明，方便生成文档后进行整理-->
        <label style="font-size:16px;">接口名称：</label>
        <label style="font-size:16px;" th:text="${table.tag}"></label>
        <table border="1" cellspacing="0" cellpadding="0" width="100%">
            <!--
            <tr class="bg">
                 <td colspan="5" th:text="${table.tag}"></td>
            </tr>
            -->
            <tr>
                <td class="bg" align="center">URL</td>
                <td colspan="4" th:text="${table.url}"></td>
            </tr>
            <tr>
                <td class="bg" align="center">请求方式</td>
                <td colspan="4" th:text="${table.requestType}"></td>
            </tr>
            <tr>
                <td class="bg" align="center">接口描述</td>
                <td colspan="4" th:text="${table.description}"></td>
            </tr>
            <tr>
                <td class="bg" align="center">请求类型</td>
                <td colspan="4" th:text="${table.requestForm}"></td>
            </tr>
            <tr>
                <td class="bg" align="center">返回类型</td>
                <td colspan="4" th:text="${table.responseForm}"></td>
            </tr>

            <tr class="bg" align="center">
                <td style="width: 100px;">参数名</td>
                <td style="width: 80px;">数据类型</td>
                <td style="width: 80px;">参数类型</td>
                <td style="width: 80px;">是否必填</td>
                <td>说明</td>
            </tr>

            <tr align="center" th:each="request:${table.requestList}">
                <td th:text="${request.name}"></td>
                <td th:text="${request.type}"></td>
                <td th:text="${request.paramType}"></td>
                <td th:if="${request.require}" th:text="Y"></td>
                <td th:if="${!request.require}" th:text="N"></td>
                <td th:text="${request.remark}"></td>
            </tr>

            <tr class="bg" align="center">
                <td>状态码</td>
                <td>描述</td>
                <td colspan="3">说明</td>
            </tr>

            <tr align="center" th:each="response:${table.responseList}">
                <td th:text="${response.name}"></td>
                <td th:text="${response.description}"></td>
                <td colspan="3" th:text="${response.remark}"></td>
            </tr>

            <tr class="bg">
                <td colspan="5">示例</td>
            </tr>
            <tr class="specialHeight">
                <td class="bg">请求参数</td>
                <td colspan="4" th:text="${table.requestParam}"></td>
            </tr>
            <tr class="specialHeight">
                <td class="bg">返回值</td>
                <td colspan="4" th:text="${table.responseParam}"></td>
            </tr>
        </table>
        <br>
    </div>
</div>
</body>
</html>
